// 导入需要的config和request
import confing from '../config/config.js';
import request from '../util/request.js';


// 申明请求对象
const userRequest = {
    // dict请求的基本url
    BASE_URL : confing.OM_URL + "/sysUser",

    // 生成生产工单编号
    list(page = 1,limit = 10,user,callback){
        let url = this.BASE_URL + "/list?page=" + page + "&limit=" + limit;
        if(user){
            if(user.username){
                url += "&username="+user.username;
            }
        }
        request.get(url,callback);
    },
    save(user,callback){
        request.post(this.BASE_URL + "/save",user,callback);
    }
}

export default userRequest;